/**
 * Copyright 2009 Aubrey Rhodes
 * Created Aug 22, 2009
 */
package com.acrhodes.JSON2Map;

import static org.junit.Assert.assertEquals;

import java.util.Map;

import org.junit.Test;

/**
 * @author Aubrey Rhodes
 * 
 */
public class TestJSON {

    @Test
    public void TestDecode() {
	String json = "{  \"name\"  :123 , \"name2\":-456e8, \"array\" : [1, \"two\", true, false, null], \"test3\" : \"string\"}";
	JSON decoder = new JSON();
	Map<String, Object> result = decoder.decode(json);
	assertEquals(123, Double.parseDouble(result.get("name").toString()), 0);
	assertEquals(-456e8,
		Double.parseDouble(result.get("name2").toString()), 0);
    }
}
